package com.nali.dal.statement.query;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import com.nali.dal.expression.PropertyExpression;
import com.nali.dal.expression.query.Criteria;

public class ConstantColumn implements ColumnUnitConfig {
	static class ConstantColumnUnit implements ColumnUnit {
		private String name;
		private Object constant;
		public ConstantColumnUnit(String name, Object constant) {
			super();
			this.name = name;
			this.constant = constant;
		}

		@Override
		public String getName() {
			return name;
		}

		@Override
		public Object getColumnValue(Map<String, Object> lineDatas) {
			return constant;
		}
	}

	private ColumnUnit columnUnit;

	public ConstantColumn(String name, Object constant) {
		columnUnit=new ConstantColumnUnit(name, constant);
	}

	@Override
	public List<PropertyExpression<Criteria>> getColumnCriterias() {
		return Collections.emptyList();
	}

	@Override
	public ColumnUnit getColumnUnit() {
		return this.columnUnit;
	}

	@Override
	public List<String> getColumns() {
		return Collections.emptyList();
	}
}
